// 构造函数注入
class Engine {
  start() {
    console.log(`Engine started`)
  }
}
class Car {
  private engine: Engine
  constructor(engine: Engine) {
    this.engine = engine
  }
  drive() {
    this.engine.start()
    console.log(`Car is running`)
  }
}
const car = new Car(new Engine())
car.drive()
export {}